package cn.walls1717.controller;

import cn.walls1717.domain.SysLog;
import cn.walls1717.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * @author CJ
 * @date 2020/8/16
 */
@Controller
@RequestMapping("/sysLog")
public class SysLogController {

    private SysLogService sysLogService;
    @Autowired
    public void setSysLogService(SysLogService sysLogService) {
        this.sysLogService = sysLogService;
    }

    @RequestMapping("/findAll")
    public ModelAndView findAll() throws Exception  {
        ModelAndView mv = new ModelAndView();
        List<SysLog> sysLogList = sysLogService.findAll();
        mv.addObject("sysLogs", sysLogList);
        mv.setViewName("syslog-list");
        return mv;
    }
}
